﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace IMIS_ERP.Web.ERP_Head
{
    public partial class EH_Page_Top : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Set_Top();
                ShowTopInfo();
                Set_Hpl();
            }
        }

        ///// <summary>绑定头部用户信息
        /////     <remarks>2010-12-12 河大信管团队-朱胜贤</remarks>
        ///// </summary>
        //private void Set_Top()
        //{
        //    hplF.Visible = false;
        //    hplS.Visible= false;
        //    hplM.Visible = false;
        //    switch(Session["UType"].ToString())
        //    {
        //        case "h_0":
        //            hplF.Visible = true;
        //            break;
        //        case "h_1":
        //            hplS.Visible = true;
        //            break;
        //        case "h_2":
        //            hplM.Visible = true;
        //            break;
        //        default:
        //            Response.Redirect("Quit.aspx?cr=no");
        //            break;
        //    }
        //}

        /// <summary>
        ///     <remarks>2011-03-07 河大信管团队-朱胜贤</remarks>
        /// </summary>
        private void Set_Hpl()
        {
            hplSale.Visible = false;
            hplSearch.Visible = false;
            if (Session["UType"].ToString() == "财务人员")
            {
                hplSale.Visible = true;
                hplSearch.Visible = true;
            }
        }

        /// <summary>绑定头部用户信息
        ///     <remarks>2010-12-02 河大信管团队-水亚亚</remarks>
        /// </summary>
        private void ShowTopInfo()
        {
            lblUId.Text = checkright1.GetUId();
            lblUName.Text = checkright1.GetUName();
            lblRule.Text = Session["UType"].ToString();
        }

        /// <summary>单击按钮事件：退出
        ///     <remarks>2010-12-02 河大信管团队-水亚亚</remarks>
        /// </summary>
        protected void lbtnLogout_Click(object sender, EventArgs e)
        {
            Response.Redirect("Quit.aspx");
        }
    }
}                                                                             